<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('编辑要素')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-wzs-edit" th:object="${aWzs}">
        <input id="aCid" name="aCid" th:field="*{aCid}" type="hidden">

        <div class="form-group">
            <label class="col-sm-3 control-label">要素名称：</label>
            <div class="col-sm-8">
                <input name="aCname" id="aCname" required th:field="*{aCname}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">权重系数：</label>
            <div class="col-sm-8">
                <input name="aCweight" id="aCweight" required th:field="*{aCweight}" class="form-control" type="number">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea name="remark" id="remark" th:field="*{remark}" class="form-control"></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
    var prefix = ctx + "system/wzs";
    $("#form-wzs-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            return $('#form-wzs-edit').serializeObject();
        }
        /*if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-wzs-edit').serialize());
        }*/
    }

    var obj = JSON.parse(window.localStorage.getItem('aCid_' + $('#aCid').val()));
    if (obj && obj.aCid) {
        $('#aCname').val(obj.aCname);
        $('#aCweight').val(obj.aCweight);
        $('#remark').val(obj.remark);
    }

</script>
</body>
</html>